Skip to content

refactor: include direct attributes in log message#122

Merged
alecthomas merged 1 commit intomainfrom
aat/log-message-context
Feb 17, 2026
Merged

refactor: include direct attributes in log message#122
alecthomas merged 1 commit intomainfrom
aat/log-message-context

Conversation

@alecthomas
Copy link
Copy Markdown
Collaborator

logger.InfoContext("My message", "err", err, "id", id)
->
{"message": "My message (err=..., id=...)", "err": "...", "id": ...}

This helps with log viewing systems like DataDog, where the message attributes can get lost in all the other inherited attributes

@alecthomas alecthomas requested a review from a team as a code owner February 17, 2026 23:46
@alecthomas alecthomas enabled auto-merge (squash) February 17, 2026 23:46
@alecthomas alecthomas disabled auto-merge February 17, 2026 23:47
```
logger.InfoContext("My message", "err", err, "id", id)
->
{"message": "My message (err=..., id=...)", "err": "...", "id": ...}
```

This helps with log viewing systems like DataDog, where the message
attributes can get lost in all the other inherited attributes
@alecthomas alecthomas force-pushed the aat/log-message-context branch from 2299b33 to 050a712 Compare February 17, 2026 23:53
@alecthomas alecthomas enabled auto-merge (squash) February 17, 2026 23:53
@alecthomas alecthomas merged commit 1e674f3 into main Feb 17, 2026
5 checks passed
@alecthomas alecthomas deleted the aat/log-message-context branch February 17, 2026 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant